//更改单位展示页面
function modinode(id){
	var url = "frontend/editdep.asp?id="+id+"&timestamp="+ new Date().getTime();
	createXMLHttpRequest();
	xmlHttp.onreadystatechange = handleStateChange1;
    xmlHttp.open("get",url,true);
    xmlHttp.send(null);
	document.all.topoperation.innerHTML = "修改";
}
//更改单位
function editnode(id){
	var x = document.getElementById("editOC").value;
	var y = document.getElementById("editPs").value;
	var z = document.getElementById("editAs").value;
	var o = document.getElementById("editTP").value;
	var p = document.getElementById("editDN").value;
	var poststring = "x="+x+"&y="+y+"&z="+z+"&o="+o+"&p="+p;
	var url = "backend/editnode.asp?id="+id+"&timestamp="+ new Date().getTime();
	createXMLHttpRequest();
	xmlHttp.onreadystatechange = handleEditNodeStateChange;
    xmlHttp.open("POST",url,true);
	xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
	xmlHttp.send(poststring);
}

function handleEditNodeStateChange() {
    if(xmlHttp.readyState == 4) {
        if(xmlHttp.status == 200) {
			var ajaxRequestObj = xmlHttp.responseText;
			if(ajaxRequestObj!="same"){
				var id = ajaxRequestObj.split("|");
				var tag = document.getElementById(nowtag);
				tag.innerHTML = tag.innerHTML.replace(id[2],id[3]);
				var hw=id[3].length;
				if(explorer==2){
					tag.style.width=36+13*hw+18;
					tag.style.maxWidth=36+13*hw+18;
				}else{
					tag.style.width=36+12*hw+18;
					tag.style.maxWidth=36+12*hw+18;
				}
				refreshdep(id[1]);
				depdetail(1,id[0]);
				showmsg('a','修改操作最后结果','单位信息修改成功！');
				document.all.topoperation.innerHTML = "修改";
			}else{
				showmsg('a','修改操作最后结果','单位重复，请使用合并单位功能！');
				document.all.topoperation.innerHTML = "修改";
			}
        }
    }
}